<?php 
/**
 * @author Kelvin 
 * @mail dangtrungkien89@gmail.com
 * */
require_once("inc_security.php");
$list = new fsDataGird($id_field,$name_field,translate_text("Countries Listing"));

/*
1: Ten truong trong bang
2: Tieu de header
3: kieu du lieu
4: co sap xep hay khong, co thi de la 1, khong thi de la 0
5: co tim kiem hay khong, co thi de la 1, khong thi de la 0
*/
$list->add("adu_admin_id","User","string",0,0);
$list->add("adu_admin_module_id","Module","string",0,0);
$list->add("adu_add","Quyền Thêm","checkbox",0,0);
$list->add("adu_edit","Quyền sửa","checkbox",0,0);
$list->add("adu_delete","Quyền xóa","checkbox",0,0);
$list->add("",translate_text("Xóa"),"delete");
$list->ajaxedit($fs_table);

//Lấy dữ liệu
$total			= new db_count("SELECT COUNT(*) AS count 
										 FROM categories
										 ORDER BY cat_id DESC "); // AND 
$db_listing 	= new db_query("SELECT * 
										 FROM admin_user,admin_user_right,modules 
                                         WHERE admin_user.adm_id=admin_user_right.adu_admin_id
                                         AND admin_user_right.adu_admin_module_id=modules.mod_id
                                         ORDER BY adm_id DESC
										 " . $list->limit($total->total));
$db_listingArr =  $db_listing->result;   	
$total_row		= 	$total->total;	
													 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php echo $load_header?>
<?php echo $list->headerScript()?>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php  /*---------Body------------*/ ?>
<!--<form action="quickedit.php?returnurl=<?php echo base64_encode(getURL())?>" method="post" name="form_listing" id="form_listing" enctype="multipart/form-data">
<input type="hidden" name="iQuick" value="update" />-->
<div id="listing">
  <?php echo $list->showHeader($total_row)?>
	
  <?php 
  	$i = 1;
	while($row	=	mysql_fetch_assoc($db_listingArr))
	{
		?>
		<?php echo $list->start_tr($i, $row['adm_id'])?>
		<td width="100" align="center"><b><?php echo $row['adm_loginname']?></b></td>
        <td width="100" align="center"><b><?php echo $row['mod_name']?></b></td>
        <td width="100" align="center"><?php if($row['adu_add']==1) echo "<img src='/../../images/site_image/checked.png' width=30 height=30/>"; else echo "<img src='/../../images/site_image/delete.png' width=30 height=30/>";?></td>
        <td width="100" align="center"><?php if($row['adu_edit']==1) echo "<img src='/../../images/site_image/checked.png' width=30 height=30/>"; else echo "<img src='/../../images/site_image/delete.png' width=30 height=30/>";?></td>
        <td width="100" align="center"><?php if($row['adu_delete']==1) echo "<img src='/../../images/site_image/checked.png' width=30 height=30/>"; else echo "<img src='/../../images/site_image/delete.png' width=30 height=30/>";?></td>
		<td width="100" align="center"><a href="delete.php?user_id=<?php echo $row['adm_id']?>&mod_id=<?php echo $row['mod_id']?>"><img src="../../resource/images/grid/delete.gif" border="0"></a></td>
		<?php echo $list->end_tr()?>
		<?php 
		$i	+=1;
	}
	?>

  <?php //=$list->showFooter($total_row)?> 
</div>
<!--</form>-->
<?php  /*---------Body------------*/ ?>
</body>
</html>